The present invention relates to an image drawing apparatus and method. One example of such an image drawing apparatus and method is a vector image drawing apparatus for providing a vector image described in a PDL language or by other methods. The present invention particularly relates to an image drawing apparatus and method (a vector image drawing apparatus) having a high speed anti-aliasing process. The word "vector" means a line (this can be a straight line or a curved line) having a direction, a length, and a position. The words "a vector image" mean an image comprising such a vector or vectors, hereinafter. A vector comprising a straight line is called "a straight line vector" and a vector comprising a curved line is called "a curved line vector", hereinafter.
Recently, a vector image printing system has come to be used in various fields, which vector image is treated in a computer graphics process. A reason for this is that so-called DTP (desk top publishing, meaning a publishing system utilizing a personal computer) has come into wide use. A typical example of that vector image printing system is a system using the "postscript" (a trade name) of Adobe Systems Incorporated (U.S.A.). "Postscript" belongs to a language group called page description languages referred to as PDL hereinafter) which are programming languages for describing the form of the contents of a page of a document. The form includes text (a part comprising characters) and graphics both of which are included in the page of the document, and the form also includes the arrangement and style of the text and graphics. A vector font is used as the character font for such a system as mentioned above.
Using such a vector font can improve the character printing quality very much even when the character size is enlarged or reduced by various factors, in comparison with a system such as one using a bit-map font (for example, a word processor in the related art). This enlargement and reduction respectively includes enlargement or reduction in the vertical direction only or the horizontal direction only and enlargement or reduction so that the enlargement or reduction ratios in the vertical direction and the horizontal direction are different from each other. Further, using such a vector font enables printing such that character fonts and graphics are combined together.
However, most laser printers or other printing apparatus used for such systems have resolutions of not finer than 240 dpi (dots per inch) through 400 dpi. Such a coarse resolution may cause undesirable jaggedness or "stair-step" (shaped like steps of a stair) to appear on an edge of a printed figure. Such a phenomena is called "aliasing" An anti-aliasing process is used to obtain a mope attractive (having a smooth edge) character printing image. The process is such that a darkness modulation is performed for a part where such a stair-step jaggedness) appears on an edge, a character printing image which appears smooth to the eye thus can be obtained. The words "darkness modulation" mean that the darkness of each pixel is controlled depending on a below mentioned area ratio.
An example of a vector image drawing apparatus in the related art (this is referred to as art related to the present invention hereinafter) is described below with reference to FIG. 1. Generally speaking, such a vector image drawing apparatus uses application software of computer or other data processors, and a document (vector data) described by PDL language is supplied to the apparatus, the apparatus then expands the vector data into multivalue image data, and the apparatus then provides such data to an output apparatus such as a multi-value color laser printer.
The word "multi-value" (used in words "multi-value image data" and "multi-value page memory" ) means that each pixel's darkness is one of multitone darkness, for example, 255 tones of darkness between white and black. This word "multi-value" is in contrast to another word "two-value" which means that each pixel's darkness is one of two tone of darkness, 10 for example, white and black, respectively represented by the binary numerals "0" and "1".
Firstly, a document is formed, such as described by PDL language using application software of computer or other data processors. Letters and graphics constituting such a formed document are treated as vector data, and such characters and graphics are then supplied to a vector processing portion 1100 in FIG. 1. The vector processing portion 1100 then converts the vector data into straight line data, the portion 1100 then performs an anti-aliasing process on the data, and the portion 1100 provides data such as an area ratio and the straight line data to a page memory drawing portion 1200. The words "straight line data" mean image drawing data arranged for each scan line. The page memory drawing portion 1200 then determines darkness values of particular pixels by using such data provided by the vector data processing portion 1100, the portion 1200 then writes the darkness values of pixels as multi-value image data onto page memory 1300. The page memory 1300, then, after completion of storing of such image data corresponding to one page as a result of writing by the page memory drawing portion 1200, transfers the stored image data in an output apparatus (not shown in FIG. 1) such as a laser printer, and the image corresponding to the image data is then printed via the output apparatus.
FIG. 2 shows a method for approximation of a curved line vector by straight line vectors (this approximation is referred to as "straight line approximation" hereinafter) if vector data supplied to the vector processing portion 1100 is a curved line vector. The distance "h" is that between the midpoint t=1/2) and a point "p" on the curved line R which is obtained from PDL language. This midpoint is that of the line segment D.sub.0 between a starting point (t=0) and an ending point (t=1) of the curved line R. The point "p" on the curved line R is that the nearest to the above mentioned mid point of the line segment D.sub.0.
A straight line approximation is performed so that vector data corresponding to the curved line R is approximated by straight lines D.sub.1 and D.sub.2 if "h" is determined as shorter then a predetermined allowable error as a result of comparing "h" and the predetermined allowable error. The straight line D.sub.1 is a line segment between the point "t=0" and the point "p", and the straight line D.sub.2 is a line segment between the point "t=1" and the point "p".
On the other hand, if the distance "h" is longer than the allowable error, then the next trial is to approximate two curved lines, produced as a result of dividing the curved line R at the point "p", into four straight lines. The first curved line is that between the point "t=0" and "p" via P.sub.1. The second curved line is that between the points "p" and "t=1" via "P.sub.2 ". The four straight lines are line segments between respective two points "t=0" and "P.sub.1 ; "P.sub.1 " and "p" (both corresponding to the first curved line); "p" and "P.sub.2 ; and P.sub.2 and "t=1" (both corresponding to the second curved line). This trial is successful if both distances "h.sub.1 " and "h.sub.2 " are respectively shorter than the allowable error, otherwise a next trial should be performed similarly. Such a process, which should be repeated as necessary as mentioned above, enables a straight line approximation.
Further, the vector processing portion 1100 performs the anti-aliasing process on the edge parts of the vector data, all curved line vectors included in which vector data has been approximated by corresponding straight line vectors as mentioned above, and the portion 1100 also performs the conversion of the vector data into a straight line data for the scanning direction, as shown in FIGS. 3 and 4A through 4C.
In an arbitrary coordinates area Y.sub.n corresponding to a sub-scanning direction, which coordinate area extends horizontally in FIG. 3, a vector V (three edges constituting a triangle) passes through respective pixels P.sub.n*n, P(n+1)*n, and P.sub.m*n respectively located in coordinates areas X.sub.n, X.sub.n+1, and X.sub.m corresponding to a main-scanning direction. Pixels such as P.sub.n*n, P(n+1)*n, and P.sub.m*n are referred to as "edge portion pixels". Thus, an anti-aliasing process should be performed on these edge portion pixels P.sub.n*n, P(n+1)*n, and P.sub.m*n, An area ratio calculating method for an anti-aliasing process is described with reference to FIGS. 4A through 4C.
FIGS. 4A through 4C show magnified views of the Yn coordinates area. Each pixel is divided into nine (9) sub-pixels (3 rows and 3 columns sub-pixel division in this example), and sub-pixels including the edge of the vector V and sub-pixels surrounded by the edges are defined as "with-data sub-pixels (Pd)", then the number of with-data sub-pixels Pd in each pixel is determined. An area ratio for each pixel thus can be obtained as the result of division of the number of with-data sub-pixels Pd by the total number of sub-pixels (nine in the example) per pixel. For example, the number of with-data sub-pixels Pd in the pixel P.sub.m*n is seven (7), the area ratio of the pixel P.sub.m*n is then obtained by the division of 7/9. The area ratio obtained as mentioned above, the corresponding coordinates, and a reference figure darkness value of each pixel are respectively supplied to the page memory drawing portion 1200. The word "reference figure darkness value" means a reference darkness value given, for example, by an operator at his request, and each darkness level constituting an image to be drawn is determined respectively based on the reference figure darkness value.
On the other hand, pixels corresponding to a range X.sub.n+1 &lt;X&lt;X.sub.m in the Y.sub.n coordinates area which are not "edge part pixels" should be printed according to the reference figure darkness value without any alteration, which values are provided in PDL language. A painting-out-in-darkness printing process (scan-line conversion) such that a corresponding whole area is painted out with one darkness should be performed on this range of pixels. Thus, the following data is sent from the vector processing portion 1100 to the page memory drawing portion 1200: starting and ending X-coordinates respectively corresponding to pixels where painting-out-in-darkness printing process should be started and ended; corresponding Y-coordinates (Y.sub.n in this example); and the reference figure darkness value. Further, vector data is converted into straight line data for the scanning direction simultaneously by such an operation as mentioned above.
The composition of data sent from the vector processing portion 1100 to the page memory drawing portion 1200 is described below with reference to FIG. 5. The data comprises the following six (6) kinds of data: command data Ds for direction writing in the page memory, D data Dd for describing a reference figure darkness value, K data Dk for describing an area ratio, XS data Dxs for describing starting coordinates in the main-scanning direction, XE data Dxe for describing ending coordinates in the main-scanning direction, and Y data Dy for describing coordinates in the sub-scanning direction. Further, each item of data has a TAG bit describing the kind of the data.
The composition of the page memory drawing portion 1200 is described below with reference to FIG. 6. All data supplied from the vector processing portion 1100 to the page memory drawing portion 1200 are applied through FIFO 1201. The TAG bit is determined by TAG decode 1207. Then a determination of 10 whether or not an anti-aliasing process should be performed on the data is executed, then a distribution of the data into each register of D register 1202, K register 1203, XS register 1204, XE register 1205, and Y register 1206 is executed.
If an anti-aliasing process should be performed, LUT(look up table) 1208 multiplies the area ratio latched in the K register 1203 by the reference figure darkness value latched in the D register 1202 for each pixel. Another LUT 1209 reads the darkness value (background color darkness) which has been previously written (painted) for a pixel in the page memory 1300, then K.sub.0 (K.sub.0 =1-(area ratio)) is multiplied by the background color darkness. Further, an adder 1210 then adds the results of the multiplications of both LUT 1208 and 1209 together. If an overflow arises during such addition, the result of the addition is set to be the maximum darkness value all bits are "1").
That is, a calculation of the following equation (1) by using read-modify-write-accessing with the page memory 1300, which calculation is the darkness-determination process of the anti-aliasing, is executed (the symbol "*", represents a multiplication of the immediate left value with the immediate right value hereinafter): (darkness value of a printer) ={(reference figure darkness value) * (area ratio)}+[(background color) * {1-(area ratio)}] (1) The words "read-modify-write-accessing" mean reading data from an address in memory and writing the data to the address in memory after modifying the data.
A printer darkness value obtained as mentioned above is written in the page memory 1300 at an address directed by the respective coordinates of the main-scanning direction and the sub-scanning direction. In the case of a painting-out-in-darkness process of a scan-line, X address counter 1212 counts from a starting address XS to an ending address XE in the main-scanning direction, the counter 1212 increments the address one by one with synchronization to pixel clocks provided from a clock generator 1213, and then the counter 1212 executes a painting-out-in-darkness process for each pixel successively (in the example of FIGS. 4A through 4C, XS =X.sub.n+2, XE=X.sub.m-1). A selector 1211 is then switched so that darkness values provided from the D register 1202 can be written without alteration to the page memory 1300 for the painting-out-in-darkness process for a scan-line.
The above mentioned processing is completed for all vector data for one page. Thus an image for the page is written in the page memory 1300. Then, after a printing command in PDL language is executed, the page memory 1300 sends stored image data (multivalue image data) to an output apparatus such as a multi-value color laser printer or other printer, thus printing via the output apparatus.
Problems arising in a vector image drawing apparatus such as mentioned above are described below. A first problem is that much time is taken for the sub-pixel painting-out-in-darkness process in the anti-aliasing process and the area ratio calculation a calculation for obtaining an area ratio) process. This results in a limitation on a processing speed. A second problem is that a method such as executing a sub-pixel painting-out-in-darkness process and an area ratio calculation process by using software by means of a CPU results in an increased load applied on the CPU.